<div class="nashome">
    <div class="container-fluid">
      <div class="text-center"><h1>上海公安NAS巡检</h1><h3><?php echo "Today : " . date("Y-m-d");?></h3></div>
      <div class="row" style="margin: 10px 0px">
          <?php foreach ($dirs as $dir ) {
                $cls = "btn ";
                if ($dir == $current) 
                    $cls = $cls .  "btn-primary";
                else $cls = $cls . "btn-default";
                echo "<a class=\"$cls\" style=\"margin-right:10px\" href=\"index.php?c=nascheck/collect&time=" . trim($dir) ."\"><i class=\"glyphicon glyphicon-list-alt\"> $dir</i></a>";
           } ?>
      </div>
      <div class="row">
        <div class="col-lg-6">
            <div class="panel panel-success">
                <div class="panel-heading">性能型集群水位(<font color=red><?php echo $walter["standard"][3]; ?></font>)</div>
                <div id="perf" style="display:none;"><?php echo json_encode($walter["standard"]); ?></div>
                <div class="panel-body">
                    <div id="performance"></div>
                </div>
            </div>
        </div>
        <div class="col-lg-6">
            <div class="panel panel-success">
                <div class="panel-heading">容量型集群水位(<font color=red><?php echo $walter["perf"][3]; ?></font>)</div>
                <div id="stand" style="display:none;"><?php echo json_encode($walter["perf"]); ?></div>
                <div class="panel-body">
                    <div id="standard"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="container-fluid">
        <div class="row">
                    <div id="cpu"></div>
        </div>
        <div class="row">
                    <div id="memory"></div>
        </div>
        <div class="row">
                    <div id="retran"></div>
        </div>
        <div class="row">
                    <div id="load"></div>
        </div>
        <div class="row">
                    <div id="bytIn"></div>
        </div>
        <div class="row">
                    <div id="bytOut"></div>
        </div>
    </div>
    <div class="panel panel-success">
        <div class="panel-heading">性能型集群机器监控</div>
        <div class="panel-body">
            <table class="table table-striped text-center">
              <thead>
                <tr class="text-center">
                  <th scope="col" rowspan="2">Machine</th>
                  <th scope="col">&nbsp;</th>
                  <th scope="col">CPU</th>
                  <th scope="col">MEMORY</th>
                  <th scope="col">TCP</th>
                  <th scope="col" colspan="2" >TRAFFIC</th>
                  <th scope="col">LOAD</th>
                </tr>
                <tr class="text-center">
                  <th scope="col">&nbsp;</th>
                  <th scope="col">UTIL</th>
                  <th scope="col">UTIL</th>
                  <th scope="col">RETRAN</th>
                  <th scope="col">BYTIN</th>
                  <th scope="col">BYTOUT</th>
                  <th scope="col">LOAD</th>
                </tr>
              </thead>
              <tbody>
                <?php $cnt = count($ret[0]->cpu); foreach($ret as $machine) { ?>
                <tr>
                  <th scope="row" rowspan="3"><?php echo $machine->host; ?></th>
                  <td>MAX</td>
                  <td><?php echo $machine->cpu[$cnt - 3]; ?></td>
                  <td><?php echo $machine->memory[$cnt - 3]; ?></td>
                  <td><?php if($machine->retran[$cnt - 3] > 1) echo "<font color=red>". $machine->retran[$cnt - 3] . "</font>"; else echo $machine->retran[$cnt - 3]; ?></td>
                  <td><?php echo $machine->bytIn[$cnt - 3]; ?></td>
                  <td><?php echo $machine->bytOut[$cnt -3]; ?></td>
                  <td><?php echo $machine->load[$cnt - 3]; ?></td>
                </tr>
                <tr>
                  <td>MIN</td>
                  <td><?php echo $machine->cpu[$cnt - 1]; ?></td>
                  <td><?php echo $machine->memory[$cnt - 1]; ?></td>
                  <td><?php echo $machine->retran[$cnt - 1]; ?></td>
                  <td><?php echo $machine->bytIn[$cnt - 1]; ?></td>
                  <td><?php echo $machine->bytOut[$cnt -1]; ?></td>
                  <td><?php echo $machine->load[$cnt - 1]; ?></td>
                </tr>
                <tr>
                  <td>AVG</td>
                  <td><?php echo $machine->cpu[$cnt - 2]; ?></td>
                  <td><?php echo $machine->memory[$cnt - 2]; ?></td>
                  <td><?php echo $machine->retran[$cnt - 2]; ?></td>
                  <td><?php echo $machine->bytIn[$cnt - 2]; ?></td>
                  <td><?php echo $machine->bytOut[$cnt -2]; ?></td>
                  <td><?php echo $machine->load[$cnt - 2]; ?></td>
                </tr>
                <?php } ?>
              </tbody>
            </table>
      </div>
    </div>
  </div>
</div>
<div style="display:none;">
    <span id="data"><?php echo json_encode($ret); ?></span>
</div>
<script src="application/assets/js/nascheck.js"></script>
